<!--  -->
<template>
  <el-form :label-width="formLabelWidth">
    <el-form-item :label="title" style="margin-bottom:0px;">
      <el-radio-group v-model="fontWeight">
        <el-radio :label="'normal'">不加粗</el-radio>
        <el-radio :label="'bolder'">加粗</el-radio>
      </el-radio-group>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  mounted () {
    this.fontWeight = this.defValue
    if (!this.fontWeight) {
      this.fontWeight = 'normal'
    }
  },
  props: {
    formLabelWidth: {
      type: String,
      default: '120px'
    },
    defValue: {
      type: String
    },
    chgValue: {
      type: Function
    },
    title: {
      type: String,
      default: '字体加粗'
    }
  },
  data () {
    return {
      fontWeight: ''
    }
  },
  watch: {
    fontWeight: {
      handler () {
        this.chgValue(this.fontWeight)
      },
      deep: true
    }
  }
}

</script>
